// _compoments/normalRoom/bottomEnterView/bottomEnterView.js
const app = getApp();

Component({
        /**
         * 组件的属性列表
         */
        properties: {
                bottomEnterData: {
                        type: Array,
                        value: [],
                },

                needHandTip: {
                        type: Boolean,
                        value: true,
                },

                isIndex: {
                        type: Boolean,
                        value: false,
                },
        },

        /**
         * 组件的初始数据
         */
        data: {
                isShowHalf: false,
                selectEnterIndex: 1,
                baseUrl: app.globalData.baseUrl,
                // selectEnterIndex: app.globalData.gCurrentRoomIndex,
                isHideHandTip: false,
        },

        /**
         * 组件的方法列表
         */
        methods: {
                onArrowClick() {
                        let temp = this.data.isShowHalf;
                        this.setData({
                                isShowHalf: !temp
                        })
                        console.log("onArrowClick " + this.data.isShowHalf)
                        this.triggerEvent("onBottomArrowClick", this.data.isShowHalf);
                },

                onEnterClick(e) {
                        let data = e.currentTarget.dataset.item
                        console.log("onEnterClick -=-=-= ", this.data.isIndex)
                        console.log("onEnterClick -=-=-= ", this.data.bottomEnterData)
                        this.triggerEvent("onBottomEnterClick", data.enterIndex);
                }
        },

        attached() {
                this.setData({
                        isShowHalf: !app.globalData.isBottomEnterExpand,
                        selectEnterIndex: app.globalData.gCurrentRoomIndex,
                });

                setTimeout(() => {
                       this.setData({
                                isHideHandTip: true
                       }) 
                }, 5000);
        },


})